<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="wechat"/>
    <title>免费评房</title>
</head>

<body>

<div class="wxAutoCreat">
    <form action="wxCreate3Step2" id="wxCreate3Form1" method="post" class="wxCreate3Form1">
        <input type="hidden" name="openId" value="${this.leads?.openId}"/>
        <input type="hidden" name="leadsId" value="${this.leads?.id}"/>
        <div class="bgcWhite wxCreate weui-cells weui-cells_form">
            <div class="weui-cell weui-cell_select" style="padding-left: 15px">
                <div class="weui-cell__hd"><label class="weui-label">贷款类型</label></div>
                <div class="weui-cell__bd weui-cell_primary">
                    <g:select class="weui-select" name="loanType" id="loanType" from="['按揭', '消费', '经营']" value="" noSelection="['':'请选择贷款类型']"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">贷款金额</label></div>

                <div class="weui-cell__bd weui-cell_primary">
                    <g:textField class="weui-input" type="text" id="requestedAmount" name="requestedAmount" value="" placeholder="请输入贷款金额" autocomplete="off"/>
                </div>
            </div>

            <div class="weui-cell weui-cell_select pl-15">
                <div class="weui-cell__hd"><label class="weui-label">网点选择</label></div>
                <div class="weui-cell__bd weui-cell_primary">
                  <g:select class="weui-select" name="branchNetwork" id="branchNetwork" from="['广州', '佛山', '东莞', '中山', '江门', '珠海', '湛江', '汕头', '惠州']" value="" noSelection="['':'请选择网点']"/>
                </div>
            </div>
        </div>

        <div class="bigBtn">
            <button type="button" class="linkBtn weui-btn weui-btn_plain_default" id="wxcreate3Step1Btn">申请贷款</button>
        </div>
    </form>
</div>



%{--提示信息和验证--}%
<div class="message-box" style="top: 20%;">
    <div class="helpMsg hide"></div>
    <g:if test="${flash.message}">
        <div class="message" role="status">
            ${flash.message}
        </div>
    </g:if>
</div>

<script>
    $(function () {
        $("#wxcreate3Step1Btn").click(function () {

            var loanType = $("#loanType").val();
            if (!loanType) {
                helpMessage("请选择贷款类型");
                return;
            }

            var requestedAmount = $("#requestedAmount").val();
            if (!requestedAmount) {
                helpMessage("请输入贷款金额");
                return;
            }

            var branchNetwork = $("#branchNetwork").val();
            if (!branchNetwork) {
                helpMessage("请选择网点");
                return;
            }

            $("#wxCreate3Form1").submit();
        });
        function helpMessage(message) {
            $(".helpMsg").text(message).fadeIn(200);
            setTimeout(function () {
                $(".helpMsg").fadeOut(200);
            }, 2000);
        }
    })
</script>
</body>
</html>
